package com.luoqiz.project.qq.server.threads;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class ChatMainThread extends Thread{

	private static boolean state=true; 
	
	@Override
	public void run() {
		int port=8999;
		System.out.println("服务器开启端口:"+port);
		ServerSocket ss=null;
		try {
			ss=new ServerSocket(port);
			while(state){
				Socket s = ss.accept();
				new SingleChatThread(s).start();
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
		
	}
}
